package pub.model;

import javax.persistence.AttributeOverride;
import javax.persistence.AttributeOverrides;
import javax.persistence.Column;
import javax.persistence.EmbeddedId;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

/**
 * Companyprovince entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "companyprovince", catalog = "sddf")
public class Companyprovince implements java.io.Serializable {

	// Fields

	private CompanyprovinceId id;
	private Company company;
	private Province province;
	private Long price;

	// Constructors

	/** default constructor */
	public Companyprovince() {
	}

	/** full constructor */
	public Companyprovince(CompanyprovinceId id, Company company, Province province, Long price) {
		this.id = id;
		this.company = company;
		this.province = province;
		this.price = price;
	}

	// Property accessors
	@EmbeddedId
	@AttributeOverrides({ @AttributeOverride(name = "company", column = @Column(name = "company", nullable = false)),
			@AttributeOverride(name = "province", column = @Column(name = "province", nullable = false)) })
	public CompanyprovinceId getId() {
		return this.id;
	}

	public void setId(CompanyprovinceId id) {
		this.id = id;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "company", nullable = false, insertable = false, updatable = false)
	public Company getCompany() {
		return this.company;
	}

	public void setCompany(Company company) {
		this.company = company;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "province", nullable = false, insertable = false, updatable = false)
	public Province getProvince() {
		return this.province;
	}

	public void setProvince(Province province) {
		this.province = province;
	}

	@Column(name = "price", nullable = false, precision = 10, scale = 0)
	public Long getPrice() {
		return this.price;
	}

	public void setPrice(Long price) {
		this.price = price;
	}

}